<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>显示密码</title>
		<style type="text/css">
			*{
				margin: 0;
				padding: 0;
			}
			#form_dl{
				width: 200px;
				height: 400px;
				margin: 200px auto;
			}
			input{
				width: 100px;
				height: 20px;
				float: left;
			}
			a{
				width: 50px;
				height: 20px;
				background: red;
				font-size: 10px;
				float: left;
				text-align: center;
				display: block;
				cursor:pointer;
			}
		</style>

	</head>
	<body>
		
		<form id="form_dl" action="" method="post">
			<input type="text" name="" id="" value="" /><br />
			<input type="password" name="" id="password" value="" />
			<a id="dj">更改</a>
			<input type="submit" value="登录"/>
			<h2>这是什么东西</h2>
			<h1>真几把难</h1>
		</form>
		<script type="text/javascript">
			window.onload = function(){
				var dianji = document.getElementById("dj");
				dianji.onclick = function(){
					var passWord = document.getElementById("password");
					alert(passWord.type)
					if(passWord.type=="password"){
						passWord.type="text";
					}else{
						passWord.type="password";//aaa
					}
				}
			}
		</script>
	</body>
</html>
